package com.mikelouis.test.scala.proginscala.chapter14

import org.scalatest.testng.TestNGSuite
import org.testng.annotations.Test

/**
 * Using TestNg but with ScalaTest assert method
 * need to extend org.scalatest.testng.TestNGSuite class
 * Created by yuazhu on 1/18/2015.
 */
class Element2TestNgTestSuite2 extends TestNGSuite {
  @Test
  def verifyUnifromElement(): Unit = {
    val ele = Element2.elem('x', 2, 3)
    assert(ele.width == 2)
    expect(3) {
      ele.height
    }

    intercept[IllegalArgumentException] {
      Element2.elem('x', -2, 3)
      throw new IllegalArgumentException("manually throw IllegalArgumentException")
    }
  }

}
